package com.mysoft.gfyx.workbench.controller;

import com.mysoft.framework.modeling.dataapi.DataApi;
import com.mysoft.framework.mvc.api.Controller;
import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.workbench.mip.WechatService;
import com.mysoft.gfyx.workbench.mip.dto.GetOpenIdByPhoneRequestDto;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.LinkedHashMap;

@PubService(value = "/wechatDataApi", prefix = RequestPrefix.API)
@Tag(name = "微信控制器-API")
public class WechatDataApiController extends Controller implements DataApi {
    @Resource
    private WechatService wechatService;

    @PubAction(value = "/getOpenId", method = RequestMethod.POST)
    public String getOpenId() {
        GetOpenIdByPhoneRequestDto getOpenIdByPhoneRequestDto = new GetOpenIdByPhoneRequestDto();
        getOpenIdByPhoneRequestDto.setKeyword("test");
        LinkedHashMap result = wechatService.getOpenIdByPhone(getOpenIdByPhoneRequestDto);
        System.out.println("result=====" + result);
        return "testopenid";
    }
}
